import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 81557
 * Date: 2025-05-30
 * Time: 下午6:59
 *///TIP 要<b>运行</b>代码，请按 <shortcut actionId="Run"/> 或
// 点击装订区域中的 <icon src="AllIcons.Actions.Execute"/> 图标。

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        //0000 0010
        for (int i = 31; i >= 1 ; i-=2) {
            System.out.print(((n>>>i) & 1) + " " );
        }
        System.out.println();
        for (int i = 30; i >= 0 ; i-=2) {
            System.out.print(((n>>>i) & 1) + " " );
        }
    }
        public static void main7(String[] args) {
        Scanner sc = new Scanner(System.in);
        String host="admin";
        String password="123456";
        int cnt=3;
        while(cnt>0){
            String username=sc.nextLine();
            String password1=sc.nextLine();
            if(username.equals(host) && password1.equals(password)){
                System.out.println("You are logged in");
                return;
            }
            else {
                cnt--;
                System.out.println("Wrong password");
            }
        }
    }
    public static void main6(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        while(n>0)
        {
            System.out.print(n%10+" ");
            n/=10;
        }
    }
    public static void main5(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        for (int i=1; i<=n; i++){
            for (int j=1; j<=i; j++){
                System.out.print(j+"*"+i+"="+i*j+"\t");
            }
            System.out.println();
        }
    }
    public static void main4(String[] args) {
        int count=0;
        for(int i=9;i<=99;i++){
            int tmp=i;
            while(tmp>0){
                if(tmp%10==9){
                    count++;
                }
                tmp=tmp/10;
            }
        }
        System.out.println(count);
    }
    public static void main3(String[] args) {
        for(int i=1000;i<=2000;i++){
            if((i%4==0&&i%100!=0)||(i%400==0)){
                System.out.println(i+"是闰年");
            }
        }
    }
    public static void main2(String[] args) {
        for(int i=1;i<=100;i++){
            main1(i);
        }
    }
        public static void main1(int n) {
//        Scanner sc = new Scanner(System.in);
//        n = sc.nextInt();
        if (n <= 1) {
//            System.out.println(n + "不是素数");
            return;
        }
        if(n==2)
        {
            System.out.println(n + "是素数");
            return;
        }
        if (n % 2 == 0) {
//            System.out.println(n + "不是素数");
            return;
        }
        int i = 3;
        for (; i <= Math.sqrt(n); i += 2) {
            if (n % i == 0) {
//                System.out.println(n + "不是素数");
//                break;
                    return;
            }
        }
        if (i > Math.sqrt(n)) {
            System.out.println(n + "是素数");
        }
    }
}
